using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace ERPBackend.Models
{
    public class Department : BaseModel
    {
            // 已移除重复的DepartmentId属性，使用BaseModel中的Id属性作为主键

        [Required]
        [MaxLength(50)]
        public string DepartmentCode { get; set; }

        [Required]
        [MaxLength(100)]
        public string DepartmentName { get; set; }

        public int? ParentDepartmentId { get; set; }

        public int? ManagerId { get; set; }

        [MaxLength(200)]
        public string Description { get; set; }

        [Required]
        public bool Status { get; set; } = true;

        // 仅保留子级导航属性
        public virtual ICollection<Department> ChildDepartments { get; set; }
        public virtual ICollection<User> Users { get; set; }
        public virtual ICollection<Workshop> Workshops { get; set; }
    }
}